What is com surrogate?

COM Surrogate is a process (dllhost.exe) that hosts COM objects outside of the process that requests them. It's essentially a stand-in process that allows programs to run COM components, such as codecs for displaying thumbnails or handling certain file types, in a separate process.

Here's some more information:

  • Purpose: The primary reason for using a COM Surrogate is to improve the stability and reliability of the calling process. If a COM object crashes, it only crashes the dllhost.exe process, not the main application.
  • How it Works: When an application needs to use a COM object configured to run in a separate process, Windows launches dllhost.exe (the COM Surrogate). The COM object is then loaded and run within the dllhost.exe process. The application communicates with the COM object through inter-process communication (IPC).
  • Benefits:
    • Improved Stability: Prevents application crashes due to faulty or unstable COM components.
    • Enhanced Security: Isolates potentially malicious COM objects from the main application.
    • Resource Management: Can help with resource management by offloading memory usage to a separate process.
  • Troubleshooting: High CPU usage by dllhost.exe can indicate problems with a COM object. Identifying the problematic COM object can be tricky but often involves disabling shell extensions or codecs. Check the Event Viewer for errors related to COM or specific file types. You can also use tools like Process Explorer to identify which COM object is loaded within a specific dllhost.exe instance.
  • Common Uses:
    • Generating thumbnails for files in File Explorer.
    • Playing media files.
    • Handling certain file operations.
  • Potential Issues: While beneficial, the COM Surrogate can sometimes lead to performance issues or errors if a COM object is poorly written or incompatible with the system.

In summary, the COM Surrogate is a crucial part of Windows that enhances system stability by isolating COM objects. Understanding its purpose and how it works is helpful for troubleshooting issues related to application crashes or high resource usage.